package com.dbms.controller;

import com.dbms.common.annotation.ResponseResult;
import com.dbms.domain.dto.BisXajmodelArearateDTO;
import com.dbms.domain.vo.BisXajmodelArearateVO;
import com.dbms.service.BisXajmodelArearateService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Tag(name = "面积管理", description = "面积管理相关接口")
@RestController
@RequestMapping("/bis_xaj_mode_arearate")
@RequiredArgsConstructor
public class BisXajmodelArearateController {

    final BisXajmodelArearateService bisXajmodelArearateService;


    @Operation(summary = "保存或修改面积参数数据", description = "保存或修改面积参数数据")
    @PostMapping("/saveOrUpdate")
    ResponseResult<Boolean> saveOrUpdate(@RequestBody BisXajmodelArearateDTO dto){
        return ResponseResult.success(bisXajmodelArearateService.saveOrUpdate(dto));
    }

    @Operation(summary = "删除面积参数数据", description = "删除面积参数数据")
    @DeleteMapping("/deleteByIds")
    ResponseResult<Boolean> deleteByIds(@RequestBody List<String> ids){
        return ResponseResult.success(bisXajmodelArearateService.deleteByIds(ids));
    }



    @Operation(summary = "根据控制站编码查询面积数据", description = "根据控制站编码查询面积数据")
    @GetMapping("/queryByStcdR")
    ResponseResult<List<BisXajmodelArearateVO>> queryByStcdR(@RequestParam("stcdR") String stcdR){
        return ResponseResult.success(bisXajmodelArearateService.queryByStcdRToList(stcdR));
    }
}
